import Vue from 'vue'
import Router from 'vue-router'

//解决push同一个路由报错
const originalPush = Router.prototype.push;
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
};

Vue.use(Router)

export default new Router({
  routes: [
    {path: '/', redirect: '/index'},
    {path: '/login', name: 'Login', component: () => import('../views/user/Login')},
    {path: '/registry', name: 'Registry', component: () => import('../views/user/Registry')},
    {path: '/forgetPassword', name: 'ForgetPassword', component: () => import('../views/user/ForgetPassword')},
  ]
})
